GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 0b5084...8dca1a )
by Vladimir
29s
created

router.post(ꞌ/:streamId?ꞌ)   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 11
rs 9.4285
1
var express = require('express');
2
3
var router  = express.Router();
4
5
router.get("/", function (req, res) {
6
  var streamId = Math.random().toString(36).substring(2);
7
  res.redirect("/" + streamId);
8
});
9
10
router.get("/:streamId?", function (req, res) {
11
  res.render("index", {
12
    host: global.host,
13
    socketIoJs: global.socketIoJs,
14
    streamId: req.params.streamId
15
  });
16
});
17
18
router.post("/:streamId?", function (req, res) {
19
  var ip = req.headers["x-forwarded-for"]
20
    || req.connection.remoteAddress
21
    || req.socket.remoteAddress
22
    || req.connection.socket.remoteAddress
23
  ;
24
  if (req.headers["content-type"] === "application/json") {
25
    global.socket.emit("log", {streamId: req.params.streamId, format: "json", data: req.body, ip: ip});
26
  }
27
  res.send("");
28
});
29
30
module.exports = router;
31